﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script src="../../../Scripts/vue.js" type="text/javascript"></script>


</head>
<body>
    <div id="App">
        <div id="bar"> </div>
        <div class="cs-content-box">
            <div id="NodeSelect" style="width:100%;margin-top:10px;margin-bottom:10px;background-color:#ffffff">
                <table style='width:100%'>
                    <caption>请选择要指定的节点</caption>
                    <tr>
                        <th>#</th>
                        <th>名称</th>
                        <th>步骤</th>
                    </tr>
                    <tr v-for="(node,index) in nodes" >
                        <td class=Idx>{{index}}</td>
                        <td v-if="selectNodes.indexOf(node.NodeID)!=-1"><input type='checkbox' name='RB_NodeNo' :value='node.NodeID' checked='checked' /><label>名称:{{node.Name}}</label></td>
                        <td v-else=v-else><label><input type='checkbox' name='RB_NodeNo' :value="node.NodeID" />节点ID:{{node.NodeID}}   -  名称:{{node.Name}}</label></td>
                        <td>{{node.Step}}</td>
                    </tr>
                    
                </table>
            </div>
        </div>
        <fieldset>
            <legend id="help">帮助</legend>
            <ul>
                <li>指定节点处理人员的身份的岗位做为计算规则.</li>
                <li>与当前操作员岗位身份不同的是，以以前的节点处理人的身份信息，部门信息，岗位信息来计算.</li>

            </ul>

        </fieldset>
    </div>
    <script type="text/javascript">
        var Baseinfo = new Vue({
            el: '#App',
            data: {
                nodes: [],
                selectNodes: "",
                deliverWay: DeliveryWay.BySpecNodeEmpStation
            },
            methods: {
                OpenStation: function () {
                    var url = "../../../Comm/RefFunc/Dot2DotStationModel.htm?EnsName=BP.WF.Template.Selectors&EnName=BP.WF.Template.Selector&AttrKey=BP.WF.Template.NodeStations";
                    var nodeID = GetQueryString("FK_Node");
                    url += '&NodeID=' + nodeID + '&ShowWay=None&M=' + Math.random();
                    OpenEasyUiDialogExtCloseFunc(url, '设置岗位', 800, 500, function () {
                        Baseinfo.stas = getStas();
                    });

                },
                OpenNew: function () {
                    var url = "../../../Comm/RefFunc/Branches.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeDepts&Dot2DotEnName=BP.WF.Template.NodeDept&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Dept&EnsOfM=BP.Port.Depts&DefaultGroupAttrKey=";
                    var nodeID = GetQueryString("FK_Node");
                    url += '&NodeID=' + nodeID + '&PKVal=' + nodeID;
                    OpenEasyUiDialogExtCloseFunc(url, '绑定部门', 800, 600, function () {
                        Baseinfo.depts = getDepts();
                    });
                },

            },
           
            created() {
                 InitBar(this.deliverWay);
                var nd = new Entity("BP.WF.Node", GetQueryString("FK_Node"));
                var ens = new Entities("BP.WF.Nodes");
                ens.Retrieve("FK_Flow", nd.FK_Flow);
                var paras = nd.DeliveryParas;
                //该流程的所有节点
                this.nodes = $.grep(ens, function (obj, i) {
                    return obj.NodeID != undefined;
                }); 
                this.selectNodes = paras==null?"":paras; //选中的节点
            }
        });



        //保存
        function Save() {
            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);
            node.DeliveryWay = Baseinfo.deliverWay;
            var object = document.getElementsByName("RB_NodeNo");
            var DeliveryParas = "";
            for (var i = 0; i < object.length; i++) {
                if (object[i].checked) {
                    DeliveryParas += object[i].value;
                    if (i < object.length - 1)
                        DeliveryParas += ',';
                }
            }
            node.DeliveryParas = DeliveryParas;
            node.Update();
        }
    </script>
</body>
</html>
